import { trans } from '@utils/common'
import { post, get, postL, getL } from '@utils/http'
import { SERVE_URL } from '@utils/config'

export default {
    apis: {
        //================消费-数据报表===========
        CONSUME_LIST: SERVE_URL + '/statics/platform/getConsumeData',
        //================消费-客户数据报表===========
        MEMBER_LIST: SERVE_URL + '/statics/platform/memberlist',


        //================加盟商-数据报表===========
        COMPANY_LIST: SERVE_URL + '/statics/platform/getCompanyData',
        //================加盟商-商品数据报表===========
        GOODS_LIST: SERVE_URL + '/statics/platform/goodslist',

        //================引流-数据报表===========
        LOGISTICS_LIST: SERVE_URL + '/statics/platform/logistics/pageList',

    },

    async consume(param) {
        const res = await trans(
            post(this.apis.CONSUME_LIST, {
                ...param
            })
        )
        return res.data
    },
    async member(pageNo, pageSize = 20, param) {
        const res = await trans(
            post(this.apis.MEMBER_LIST, {
                pageNo,
                pageSize,
                ...param
            })
        )
        return res
    },
    async company(pageNo, pageSize = 20, param) {
        const res = await trans(
            post(this.apis.COMPANY_LIST, {
                pageNo,
                pageSize,
                ...param
            })
        )
        return res.data
    },
    async goods(pageNo, pageSize = 20, param) {
        const res = await trans(
            post(this.apis.GOODS_LIST, {
                pageNo,
                pageSize,
                ...param
            })
        )
        return res.data
    },


    async logistics(pageNo, pageSize = 20, param) {
        const res = await trans(
            post(this.apis.LOGISTICS_LIST, {
                pageNo,
                pageSize,
                ...param
            })
        )
        return res
    },
}
